<template>
  <page-view>
    <page-header :title="订单">
    </page-header>
    <div class="content-box">



        <list
            v-model:loading="loading"
            :finished="finished"
            finished-text="没有更多了"
            @load="onLoad"
            >
          <!-- <div v-for="item in orderInfo" :key="item.id">
          </div> -->
        </list> 
    </div>
  </page-view>
</template>

<script>
import { useStore } from 'vuex'
import { useRouter ,useRoute} from 'vue-router'
import PageView from '../components/PageView.vue';
import PageHeader from '../components/PageHeader.vue';
import { List,Image as VanImage} from 'vant';
import { reactive, toRefs } from '@vue/reactivity';
import api from '../utils/api';
export default {
  components: { PageView, PageHeader,List,VanImage },
  name:'Order',
  setup () {
    const route=useRoute();
    let orderInfo=reactive({

    })
    let info=reactive({
      loading:false,
      finished:true,


    })

const getOrder=async (pageIndex)=>{
    info.loading=true;
    let result=await api.orderInfo.getMyOrderListByPage(pageIndex)
   console.log(result)
    // foodData.pageCount=result.pageCount
    // foodData.pageIndex=+result.pageIndex
    // foodData.pageStart=result.pageStart
    // foodData.pageEnd=result.pageEnd
    // foodData.totalCount=result.totalCount
//处理图片网络地址foodDate.foodList=result.listData

// result.listData.map((item)=>{
//     item.food_img=proxy.BaseURL+item.food_img
   
//   })
  


info.loading.value=false;//加载完之后需要手动关闭
// info.finished.value=foodData.pageIndex >=foodData.pageCount
//  refreshing.value = false;

}

getOrder(1)





    //下滚懒加载
    function onLoad(){

    }
    return {onLoad,...toRefs(info),orderInfo}
  }
}
</script>

<style lang="scss" scoped>

</style>